package com.ali.thread;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ProductThread extends Thread {
    private final Product product;

    public ProductThread(Product product) {
        this.product = product;
    }

    @Override
    public void run() {
        while (true) {
            boolean result = product.sell3();
            log.info("result：" + result);
            if (!result) {
                break;
            }
        }
    }
}
